/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.reflection;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

/**
 * <p>Project: javaseapp - Ref1
 * <p>Powered by webrx On 2021-08-30 15:04:46
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
@SuppressWarnings("all")
public class Ref1 {
    public static void main(String[] args) {


        //反射类 获取String的反射类
        Class<String> c = String.class;
        var c2 = String.class;
        System.out.println(c == c2); //true

        Method[] ms = c.getDeclaredMethods();
        //Arrays.stream(ms).forEach(System.out::println);
        var cc = c.getDeclaredConstructors();
        //反射输出所有构造方法名称
        for (Constructor c1 : cc) {
            System.out.println(c1.getName());
        }
        //反射输出所有方法名称
        for (var m : ms) {
            System.out.println(m.getName());
        }
    }
}
